
import { HashRouter, Routes, Route, Navigate } from 'react-router-dom';
import Login from './pages/login'
import Layout from './pages/layout'
import Home from './pages/home'
import Notfound  from './pages/notfound';
import UserCenter from './pages/userCenter';
import RouteApi from './apis/menu'
import React, {useEffect,useState} from 'react'
function App() {
  const User = React.lazy(()=>import('./pages/system/user/user'))
  const System = React.lazy(()=>import('./pages/system/system'))
  const Roles = React.lazy(()=>import('./pages/system/roles'))
  return (
    <React.Suspense fallback={<div>...加载中</div>}>
 <HashRouter>
  <Routes>
    <Route path='/' element={<Navigate to={'login'}/>}/>
    <Route path='/login' element={<Login></Login>}/>
    <Route path='/layout' element={<Layout/>}>
    <Route path='/layout/home' element={<Home/>}/>
    <Route path='/layout/userCenter' element={<UserCenter/>}/>
    <Route path='/layout/system' element={<System/>}>
      <Route path='/layout/system/user' element={<User/>}/>
      <Route path='/layout/system/role' element={<Roles/>}/>
    </Route>
    </Route>
    <Route path='*' element={<Notfound/>}/>
  </Routes>
 </HashRouter>
 </React.Suspense>
  )
}

export default App
